import java.util.Arrays;
import java.util.Scanner;

public class Main1211 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        int[] arr1=new int[arr.length+1];
        for (int i=0;i<n;i++){
            arr[i]=sc.nextInt();
        }int x = sc.nextInt();
        int y = sc.nextInt();
        for (int i=0;i<arr.length;i++){
            arr1[i]=arr[i];
        }
        for (int i=arr1.length-1;i>x-1;i--){
            arr1[i]=arr1[i-1];
        }
        arr1[x-1]=y;
        arr=arr1;
     //   System.out.println(Arrays.toString(arr));
        for (int i=0;i< arr.length;i++){
            System.out.print(arr[i]+" ");
        }
    }
}
